<?php
/**
 * GioCMS
 * 
 * LICENSE
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE Version 2 
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-2.0.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@ninhgio.com so we can send you a copy immediately.
 * 
 * @copyright	Copyright (c) 2010 GioCMS (http://www.ninhgio.com)
 * @license		http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE Version 2
 */
?>
<?php if (isset($this->user) && $this->user) : ?>
if ($ == jQuery) {
	$.noConflict();
	$GIO = jQuery;
}

var initGioProfileWidget_<?php echo $this->id; ?> = function () {
	$GIO('#gio_profile_widget_container_<?php echo $this->id; ?>').css( { 'margin':'<?php echo $this->margin; ?>', 'padding':'0', 'width':'295px', 'border':'1px solid black', 'font-family':'helvetica,arial', 'font-size':'11px', 'color':'#000', 'background-color':'#fff' } );

	$GIO('<a id="gio_profile_widget_logo_<?php echo $this->id; ?>" href="<?php echo $this->user['website']; ?>" target="_blank" style="background-color:#000; color:#fff; font-weight:bold; font-size:16px; line-height:16px; text-decoration:none; display:block; margin:0; padding:8px 0 6px 10px; text-align:left; border:0; letter-spacing:1.8px;"><?php echo str_replace('http://', '', $this->user['website']); ?></a>').appendTo('#gio_profile_widget_container_<?php echo $this->id; ?>');
	$GIO('#gio_profile_widget_logo_<?php echo $this->id; ?>').hover(
		function() { $GIO(this).css( { 'background-color':'#00C2F2' } ); },
		function() { $GIO(this).css( { 'background-color':'#000 '} 
	); 
});

$GIO('<div id="gio_profile_widget_contents_<?php echo $this->id; ?>" style="margin:0;"></div>').appendTo('#gio_profile_widget_container_<?php echo $this->id; ?>');
$GIO('<a style="border:0; color:#000; float:left; display:block; width:75px; margin:10px 0 0 10px;" href="http://lookbook.nu/user/<?php echo $this->id; ?>-Ninh-G?profilewidget" target="_blank"><img alt="<?php echo $this->user['username']; ?>" style="width: 75px;" onerror="$GIO(this).attr(\'src\', \'<?php echo $this->APP_STATIC_SERVER; ?>/images/avatar/guy.gif\');" src="<?php if ($this->user['avatar']) : ?><?php echo $this->user['avatar']; ?><?php else : ?><?php echo $this->APP_STATIC_SERVER; ?>/images/avatar/guy.gif<?php endif; ?>" style="border:0;" /></a>').appendTo('#gio_profile_widget_contents_<?php echo $this->id; ?>');
$GIO('<div id="gio_profile_widget_info_<?php echo $this->id; ?>" style="margin:10px 10px; 0 10px; float:left; width:190px; overflow:hidden;"></div>').appendTo('#gio_profile_widget_contents_<?php echo $this->id; ?>');
$GIO('<p style="text-align:left; text-transform:none; font-size:18px; line-height:18px; font-weight:normal; margin:0 0 2px 0;"><a id="gio_profile_widget_name_<?php echo $this->id; ?>" style="border:0; font-size:18px; line-height:18px; color:#000; text-decoration:none; font-weight:normal;" href="<?php echo $this->user['website']; ?>" target="_blank"><?php echo $this->user['fullname']; ?></a></p>').appendTo('#gio_profile_widget_info_<?php echo $this->id; ?>');
$GIO('#gio_profile_widget_name_<?php echo $this->id; ?>').hover(
	function () { $GIO(this).css( { 'color':'#fff', 'background-color':'#000' } ); },
	function () { $GIO(this).css( { 'color':'#000', 'background-color':'transparent' } ); }
);

$GIO('<p style="text-align:left; text-transform:uppercase; font-size:11px; margin:0 0 2px 0; line-height:14px; font-weight:bold;"><?php echo date('Y') - date('Y', strtotime($this->user['birthdate'])); ?> <?php echo $this->TRANSLATOR->translator('widget_profile_year_old'); ?>, <?php echo sprintf($this->TRANSLATOR->translator('widget_profile_address'), $this->user['address']); ?></p>').appendTo('#gio_profile_widget_info_<?php echo $this->id; ?>');
$GIO('<p style="text-align:left; font-size:11px; margin:0 0 2px 0; line-height:14px; font-weight:bold;"><?php echo sprintf($this->TRANSLATOR->translator('widget_profile_email'), $this->user['email']); ?></p>').appendTo('#gio_profile_widget_info_<?php echo $this->id; ?>');
$GIO('<table id="gio_profile_widget_table_<?php echo $this->id; ?>" cellspacing="0" cellpadding="0" border="0" style="margin: 0 auto 0 0;"></table>').appendTo('#gio_profile_widget_info_<?php echo $this->id; ?>');

$GIO('<tr><td style="width:45px; color:#aaa; font-size:11px; margin:0; line-height:14px;">Fans:</td><td style="color:#aaa; font-size:11px; margin:0; line-height:14px;">0</td></tr>').appendTo('#gio_profile_widget_table_<?php echo $this->id; ?>');
$GIO('<tr><td style="width:45px; color:#aaa; font-size:11px; margin:0; line-height:14px;">Looks:</td><td style="color:#aaa; font-size:11px; margin:0; line-height:14px;">0</td></tr>').appendTo('#gio_profile_widget_table_<?php echo $this->id; ?>');
$GIO('<tr><td style="width:45px; color:#aaa; font-size:11px; margin:0; line-height:14px;"><img alt="Love" src="http://cdn4.lookbook.nu/images/love.gif?1300186803" style="position:relative; top:0px; height:7px; border:0;" />:</td><td style="color:#aaa; font-size:11px; margin:0; line-height:14px;">0</td></tr>').appendTo('#gio_profile_widget_table_<?php echo $this->id; ?>');
$GIO('<tr><td style="width:45px; color:#aaa; font-size:11px; margin:0; line-height:14px;">Karma:</td><td style="color:#aaa; font-size:11px; margin:0; line-height:14px;">0</td></tr>').appendTo('#profile_widget_table_<?php echo $this->id; ?>');
$GIO('<div style="clear:both;"></div>').appendTo('#gio_profile_widget_contents_<?php echo $this->id; ?>');

}
$GIO(document).ready(initGioProfileWidget_<?php echo $this->id; ?>);
<?php endif; ?>